package cn.com.zacm.app.anquanmao_sdk_demo

import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.widget.Toast
import androidx.appcompat.app.AppCompatActivity
import cn.com.zacm.app.anquanmao_sdk_demo.databinding.ActivityDemoBinding
import com.haixue.saas.main.SaasEntrance

class DemoActivity : AppCompatActivity() {

    private lateinit var binding: ActivityDemoBinding

    override fun onCreate(savedInstanceState: Bundle?) {
        binding = ActivityDemoBinding.inflate(LayoutInflater.from(this))
        super.onCreate(savedInstanceState)
        setContentView(binding.root)
        binding.activity = this
    }

    fun goSassPage(view: View) {
        SaasEntrance.openSaas(view.context,
            "12345",
            "张三sdk-demo",
            "13000000111",
            "财务部",
            "1.0.0",
            "hkbn35fx49gog5zu4zqxi",
            "fmlDURLNDsEWoV27NcxNaTk8MmbjMCRo",
            null,  object : SaasEntrance.SaasEntranceCallback {
                override fun onFailure(code: Int?, message: String?) {
                    Toast.makeText(view.context, "$code $message", Toast.LENGTH_SHORT).show()
                }

                override fun onSuccess() {
                }
            }
        )
    }
}